import request from '@/common/js/request.js'

const api = {
	upload: '/file/upload',
	getFile: '/file/get',
	queryEnumerationValuesByName: '/ha_enumerationvalue/queryEnumerationValuesByName'
}

/**
 * 文件上传
 * @param {Object} data
 */
export function minioUpload(data) {
	var body = new FormData()
	body.append("file", data);
	return request({
		url: api.upload,
		method: 'post',
		data: body
	})
}

/* 
 *	获取附件信息
 */
export function getFile(parameter) {
	return request({
		url: api.getFile,
		method: 'post',
		params: parameter
	})
}

/**
 * 查询枚举枚举项
 */
export function queryEnumerationValuesByName(parameter) {
	return request({
		url: api.queryEnumerationValuesByName,
		method: 'post',
		params: parameter
	})
}